home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Examples / Bitmap / Include / BmpPart.h < prev    next >
Encoding:
Text File  |  1994-04-21  |  2.8 KB  |  105 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                BmpPart.h
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //    Creation Date:        3/28/94
  8. //
  9. //    Copyright:    © 1993, 1994 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //========================================================================================
  12.  
  13. #ifndef BMPPART_H
  14. #define BMPPART_H
  15.  
  16. #ifndef BMPDEF_H
  17. #include "BmpDef.h"
  18. #endif
  19.  
  20. // ----- Famework Includes -----
  21.  
  22. #ifndef FWPART_H
  23. #include "FWPart.h"
  24. #endif
  25.  
  26. // ----- Graphic Includes -----
  27.  
  28. #ifndef FWBMPSHP_H
  29. #include "FWBMPShp.h"
  30. #endif
  31.  
  32. //========================================================================================
  33. //    •• Constants
  34. //========================================================================================
  35.  
  36. const short kDisplayMenu = 4;
  37.  
  38. // ----- Commands -----
  39. const XMPCommandID cHalfSize    = 1;
  40. const XMPCommandID cRealSize    = cHalfSize + 1;
  41. const XMPCommandID cDoubleSize    = cRealSize + 1;
  42. const XMPCommandID cCustomSize    = -1;
  43.  
  44. //========================================================================================
  45. //    •• Forward Declarations
  46. //========================================================================================
  47.  
  48. class CBitmapSelection;
  49. class FW_CRect;
  50.  
  51. //========================================================================================
  52. //    •• class CBitmapPart
  53. //========================================================================================
  54.  
  55. class CBitmapPart : public FW_CPart
  56. {
  57. //----------------------------------------------------------------------------------------
  58. //    • Initialization/Destruction
  59. //
  60. public:
  61.     CBitmapPart();
  62.     virtual ~ CDECL CBitmapPart();
  63.     
  64.     virtual void Initialize();
  65.     virtual void Release();
  66.  
  67. //----------------------------------------------------------------------------------------
  68. //    • Inherited API
  69. //
  70. public:
  71.     virtual void             InternalizeContent(XMPStorageUnit* storageUnit);
  72.     virtual void             ExternalizeContent(XMPStorageUnit* storageUnit);
  73.     
  74.     virtual XMPValueType     GetContentPropertyValueType() const;
  75.     
  76.     virtual FW_CFrame*     NewFrame(XMPFrame* xmpFrame, XMPTypeToken presentation);
  77.     virtual FW_CSelection* NewSelection();
  78.  
  79.     virtual void            DoAdjustMenus(XMPMenuBar* menuBar);
  80.  
  81.     virtual FW_Boolean        DoIdle();
  82.  
  83. //----------------------------------------------------------------------------------------
  84. //    • New API
  85. //
  86. public:
  87.     FW_CBitmapShape         GetBitmapShape() const
  88.                                 {return fBitmapShape;}
  89.     void                     SetBitmap(FW_CBitmapShape bitmapShape);
  90.  
  91.     void                    CalcBitmapRect(FW_CRect *rect, long zoomFactor) const;
  92.     
  93.     CBitmapSelection*        GetBitmapSelection() const
  94.                                 {return fBitmapSelection;}
  95.         
  96. //----------------------------------------------------------------------------------------
  97. //    • Data Members
  98. //
  99. private:
  100.     FW_CBitmapShape            fBitmapShape;
  101.     MenuHandle                fDisplayMenu;
  102.     CBitmapSelection*        fBitmapSelection;
  103. };
  104. #endif
  105.